package com.zhtools.wx;

import com.zhtools.wx.bean.*;
import com.zhtools.wx.exception.WXPayException;

/**
 * @author zhanghao
 * 微信支付服务接口
 */
public interface WXPayService {
    /**
     * 获取沙箱环境密钥
     *
     * @return
     */
    GetSandBoxSecretResponse getSandBoxSecret() throws WXPayException;

    /**
     * 统一下单
     */
    UnityOrderResponse unityOrder(WXPayOrder payOrder) throws WXPayException;

    /**
     * 根据商户订单号查询订单详情
     *
     * @param outTradeNo
     * @return
     */
    OrderQueryResponse orderQuery(String outTradeNo) throws WXPayException;

    /**
     * 退款申请
     *
     * @param params
     * @throws WXPayException
     */
    FefundResponse refund(WXPayRequestParams params) throws WXPayException;

    /**
     * 根据商户订单号查询退款明细 (返回前10条记录)
     *
     * @param outTradeNo
     * @throws WXPayException
     */
    RefundQueryResponse refundQuery(String outTradeNo) throws WXPayException;

    /**
     * 下载对账单
     *
     * @param params
     * @return
     * @throws WXPayException
     */
    String downLoadBill(DownLoadBillRquest params) throws WXPayException;

    /**
     * 微信支付回调
     */
    WXPayCallBackResponse payCallBack(String body) throws WXPayException;

    /**
     * 响应成功
     */
    String responseSuccess();

    /**
     * 响应失败
     */
    String responseFail(String message);
}
